package com.ruoyi.pms.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pms.mapper.PmsAttrKeyMapper;
import com.ruoyi.pms.domain.PmsAttrKey;
import com.ruoyi.pms.service.IPmsAttrKeyService;

/**
 * 商品属性名Service业务层处理
 * 
 * @author yf
 * @date 2022-02-13
 */
@Service
public class PmsAttrKeyServiceImpl implements IPmsAttrKeyService 
{
    @Autowired
    private PmsAttrKeyMapper pmsAttrKeyMapper;


    /**
     * 查询商品属性名
     * 
     * @param id 商品属性名主键
     * @return 商品属性名
     */
    @Override
    public PmsAttrKey selectPmsAttrKeyById(Long id)
    {
        return pmsAttrKeyMapper.selectPmsAttrKeyById(id);
    }

    /**
     * 查询商品属性名列表
     * 
     * @param pmsAttrKey 商品属性名
     * @return 商品属性名
     */
    @Override
    public List<PmsAttrKey> selectPmsAttrKeyList(PmsAttrKey pmsAttrKey)
    {
        return pmsAttrKeyMapper.selectPmsAttrKeyList(pmsAttrKey);
    }

    /**
     * 新增商品属性名
     * 
     * @param pmsAttrKey 商品属性名
     * @return 结果
     */
    @Override
    public int insertPmsAttrKey(PmsAttrKey pmsAttrKey)
    {
        pmsAttrKey.setCreateTime(DateUtils.getNowDate());
        return pmsAttrKeyMapper.insertPmsAttrKey(pmsAttrKey);
    }

    /**
     * 修改商品属性名
     * 
     * @param pmsAttrKey 商品属性名
     * @return 结果
     */
    @Override
    public int updatePmsAttrKey(PmsAttrKey pmsAttrKey)
    {
        return pmsAttrKeyMapper.updatePmsAttrKey(pmsAttrKey);
    }

    /**
     * 批量删除商品属性名
     * 
     * @param ids 需要删除的商品属性名主键
     * @return 结果
     */
    @Override
    public int deletePmsAttrKeyByIds(Long[] ids)
    {
        return pmsAttrKeyMapper.deletePmsAttrKeyByIds(ids);
    }

    /**
     * 删除商品属性名信息
     * 
     * @param id 商品属性名主键
     * @return 结果
     */
    @Override
    public int deletePmsAttrKeyById(Long id)
    {
        return pmsAttrKeyMapper.deletePmsAttrKeyById(id);
    }
}
